package stu.day44;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class hw1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] nums = new int[n];

        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
        }

        int x = 2;
        int first = 0;
        int second = 0;

        HashMap<Integer, Integer> dic = new HashMap<>();

        for (int i = 0; i < k; i++) {
            int num = nums[i];
            if (num > k) {
                dic.put(num, i);
            }
        }

        if (dic.size() <= 1) {
            int[] result = getAns(nums, dic, k - 1, k);
            x = result[0];
            first = result[1];
            second = result[2];
        } else {
            for (int right = k, rightNum; right < n; right++) {
                rightNum = nums[right];
                if (rightNum > k) {
                    dic.put(rightNum, right);
                }

                int left = right - k;
                int leftNum = nums[left];

                if (leftNum > k) {
                    dic.remove(leftNum);
                }

                if (dic.size() <= 1) {
                    int[] result = getAns(nums, dic, right, k);
                    x = result[0];
                    first = result[1];
                    second = result[2];
                    break;
                }
            }
        }

        if (x <= 1) {
            System.out.println("YES");
            if (x == 1) {
                System.out.println(1);
                if (first > second) {
                    int temp = first;
                    first = second;
                    second = temp;
                }
                System.out.println(first + " " + second);
            } else {
                System.out.println(0);
            }
        } else {
            System.out.println("NO");
        }
    }

    public static int[] getAns(int[] nums, HashMap<Integer, Integer> dic, int right, int k) {
        int x = 0;
        int first = 0;
        int second = 0;

        if (dic.size() == 0) {
            x = 0;
        } else if (dic.size() == 1) {
            for (Map.Entry<Integer, Integer> entry : dic.entrySet()) {
                first = entry.getValue();
                int numMiss = ((1 + k) * k / 2) - (Arrays.stream(nums, right - k + 1, right + 1).sum() - entry.getKey());
                second = findIndex(nums, numMiss);
                if (second == right + 1 && first == right - k + 1) {
                    x = 0;
                } else {
                    x = 1;
                }
            }
        }

        return new int[]{x, first, second};
    }

    public static int findIndex(int[] arr, int target) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == target) {
                return i;
            }
        }
        return -1;
    }
}
